home *** CD-ROM | disk | FTP | other *** search
/ 95.86.62.111 / 95.86.62.111.tar / 95.86.62.111 / Active Sync 4.5.rar / Active Sync 4.5 / setup.msi / ActiveSync.cab / activesync.chm.48F17E76_FD07_4BE3_97CE_1B27523FD30B / scripts / dtue_ie5.js < prev    next >
Text File  |  2006-10-01  |  53KB  |  1,961 lines

  1. // VERSION 7.1.2232
  2. // This script works with IE 5.x+. Optimized for IE6.x
  3.  
  4. //************************** Persistence VARIABLES ***************************
  5. // These variables were added to support the Persistence functionality (EDG UA).
  6.  
  7. var isIE5 = (navigator.appVersion.indexOf("MSIE 5")>0) || (navigator.appVersion.indexOf("MSIE")>0 && parseInt(navigator.appVersion)> 4);
  8. var isIE55 = (navigator.appVersion.indexOf("MSIE 5.5")>0);
  9. if (isIE5 && isIE55) isIE5 = false;
  10. var isIE6 = (navigator.appVersion.indexOf("MSIE 6")>0);
  11.  
  12. if (!isIE5 && !isIE55 && !isIE6) {
  13.     isIE6 = true;
  14.     }
  15.  
  16. var isPersistent = false;
  17.  
  18. //************************** LOCALIZATION VARIABLES ***************************
  19.  
  20. // Variables for Feedback links
  21. var L_FeedbackLink_TEXT = "Send feedback to Microsoft";
  22. var L_MessageLink_TEXT = "Microsoft Product Support Knowledge Base Link";
  23. var L_MailToLink_TEXT = "Send feedback to Microsoft";
  24.  
  25. // Variables for the running head buttons
  26. var L_SeeAlso_TEXT = "See Also";
  27. var L_Requirements_TEXT = "Requirements";
  28. var L_QuickInfo_TEXT = "QuickInfo";
  29. var L_FilterTip_TEXT = "Language Filter";        // tooltip for language button
  30. var L_Language_TEXT = "Language";        // heading for menu of programming languages
  31. var L_ShowAll_TEXT = "Show All";        // label for 'show all languages' menu item
  32.  
  33. // Variables for Expand-Collapse functions
  34. var L_ExpandAll_TEXT = "Expand All";
  35. var L_CollapseAll_TEXT = "Collapse All";
  36. var L_ExColl_TEXT = "Click to Expand or Collapse";
  37.  
  38. // Localization Variables for NavFailPage Param
  39. var L_Keyword_TEXT = "Keyword =";
  40. var L_IndexMoniker_TEXT = "IndexMoniker =";
  41. var L_URL_TEXT = "Source URL =";
  42.  
  43. // defines the running head popup box. Localizable
  44. var L_PopUpBoxStyle_Style = "WIDTH:200PX; PADDING:5px 7px 7px 7px; BACKGROUND-COLOR:#FFFFCC; BORDER:SOLID 1 #999999; VISIBILITY:HIDDEN; POSITION:ABSOLUTE; TOP:0PX; LEFT:0PX; Z-INDEX:2;";
  45.  
  46. //*************************** END LOCALIZATION ********************************
  47.  
  48. //**** Do not localize the following lines, they allow for bilingual files ****
  49. var US_See_Also = "See Also";
  50. var US_Requirements = "Requirements";
  51. var US_QuickInfo = "QuickInfo"
  52.  
  53. //***ScriptSettings
  54. var bRefTips = true        //Show RefTips
  55. var bInCHM = false        //CHM check
  56. var popOpen, theImg, theDiv, e;
  57. var advanced = false;
  58. var curLangs = null;
  59. var scrollPos = 0;
  60. var baseUrl = jsPath; //jsPath comes from the dtuelink.js
  61. var popupDIV = "<DIV ID='popUpWindow' STYLE='"+L_PopUpBoxStyle_Style+"'>" + "</DIV>";
  62.  
  63. //***************************** END VARIABLES *********************************
  64.  
  65. // ****************************************************************************
  66. // *                           Common code                                    *
  67. // ****************************************************************************
  68.  
  69.  
  70. // Check for <meta Name="RefTips" Content="False">
  71. if (bRefTips==true){
  72.     var mColl = document.all.tags("META");
  73.     for (i=0; i<mColl.length; i++){
  74.         if (mColl(i).name.toUpperCase()=="REFTIPS"){
  75.             if (mColl(i).content.toUpperCase()=="FALSE") bRefTips = false;
  76.         }
  77.     }
  78. }
  79.  
  80. // Check for <META Name="InChm" Content="True">
  81. if (bInCHM==false){
  82.     var mColl = document.all.tags("META");
  83.     for (i=0; i<mColl.length; i++){
  84.         if (mColl(i).name.toUpperCase()=="INCHM"){
  85.             if (mColl(i).content.toUpperCase()=="TRUE") bInCHM = true;
  86.         }
  87.     }
  88. }
  89.  
  90. if (ieVer >= 5) {
  91.     var advanced = true;
  92. }
  93.  
  94. if (advanced) {
  95.  
  96.     window.onload = bodyOnLoad;
  97.     window.onbeforeprint = set_to_print;
  98.     window.onafterprint = reset_form;
  99.  
  100.     // This was added to support the Persistence functionality (EDG UA).
  101.         var contextID= addID();
  102.         contextID = contextID.toLowerCase();
  103.         //var isHowTo= contextID.indexOf('howhow');
  104.     var isHowTo= contextID.indexOf('how');
  105.  
  106.         if (isHowTo > 0) {
  107.       window.onunload=saveChecklistState;
  108.         }
  109. }
  110.  
  111. //**************************** END COMMON CODE ********************************
  112.  
  113. function finishOnLoad(){
  114.     document.onkeypress = ieKey;
  115.     window.onresize = closeIE4;
  116.     document.body.onclick = bodyOnClick;
  117.     //IF THE USER HAS IE4+ THEY WILL BE ABLE TO VIEW POPUP BOXES
  118.     if (advanced){
  119.         document.body.insertAdjacentHTML('beforeEnd', popupDIV);
  120.     }
  121. return;
  122. }
  123.  
  124.  
  125. function bodyOnClick(){
  126.     if (advanced) {
  127.         var elem = window.event.srcElement;
  128.         for (; elem; elem = elem.parentElement) {
  129.             if (elem.id == "reftip")
  130.                 return;
  131.         }
  132.         hideTip();
  133.         closeMenu();
  134.         hideSeeAlso();
  135.         resizeBan();
  136.     }
  137. }
  138.  
  139.  
  140. function ieKey(){
  141.     if (window.event.keyCode == 27){
  142.         hideTip();
  143.         closeMenu();
  144.         hideSeeAlso();
  145.         resizeBan();
  146.         closeIE4();
  147.     }
  148. return;
  149. }
  150.  
  151.  
  152. function closeIE4(){
  153.     document.all.popUpWindow.style.visibility = "hidden";
  154.     popOpen = false;
  155.     resizeBan();  //also resize the non-scrolling banner
  156. return;
  157. }
  158.  
  159.  
  160. function bodyOnLoad(){
  161.  
  162. //*********************************************************************************
  163. // This was added to support the Persistence functionality.
  164.  
  165. //Check if topic is a How-to.
  166.  
  167. var contextID= addID();
  168. contextID = contextID.toLowerCase();
  169. //var isHowTo= contextID.indexOf('howhow');
  170.  
  171. isPersistent = (document.all.item("checklist")!=null);
  172.  
  173. //if (isPersistent && isHowTo > 0) getChecklistState();
  174. if (isPersistent) getChecklistState();
  175.  
  176.  
  177.     if (advanced) { 
  178.  
  179.         
  180.         try{
  181.             // Wire up event handlers that required the body to have been instantiated.
  182.             document.body.oncopy = procCodeSelection;
  183.         } catch(e){}
  184.         
  185.         // Process language-specific subsections and data structures
  186.         // Create the language menu
  187.         initLangs();
  188.         
  189.         // Filter topic as appropriate for the context
  190.         if (curLangs != null) {
  191.             curLangs.filterTopicForLang(null, false);
  192.         }
  193.  
  194.         resizeBan();
  195.         
  196.         if (bRefTips==true) initReftips();
  197.         initSeeAlso();
  198.         
  199.     }
  200.     
  201.     
  202.     finishOnLoad();
  203.     //set the scroll position
  204.     try{nstext.scrollTop = scrollPos;}
  205.     catch(e){}
  206.     
  207. }
  208.  
  209.  
  210. // ****************************************************************************
  211. // *                        Language filtering                                *
  212. // ****************************************************************************
  213.  
  214.  
  215.  
  216. // ------------------------- CurLangList class --------------------------------
  217.  
  218. function CurLangList(docLangList){
  219.     // Current Lang Object ctor: Only instantiated if needed.
  220.  
  221.     // Member fields
  222.     this.langList = null;
  223.     this.showAll = true;
  224.     this.cook = null;
  225.  
  226.     var address = location.href;
  227.     var bookmarkStart = address.indexOf("#");
  228.     var tempLangList = null;
  229.     
  230.     var obj = document.all.obj_cook;
  231.     if (obj && obj.object) {
  232.         this.cook = obj;
  233.     }
  234.     
  235.     
  236.     // (Try 1) If it has a bookmark, check to see if Language is near A Name
  237.     if (bookmarkStart > -1){
  238.         // Results in a single-item langList
  239.         var bookmark = address.substring(bookmarkStart + 1);
  240.         tempLangList = new Array(1);
  241.         tempLangList[0] = findLanguage(bookmark);
  242.     }
  243.  
  244.     // (Try 2) Check the dynamic help window for current language.
  245.     if (tempLangList == null) {
  246.         // Could result in a multi-item langList
  247.         try{
  248.             for (i=1; i< window.external.ContextAttributes.Count; i++){
  249.                 if(window.external.ContextAttributes(i).Name.toUpperCase()=="DEVLANG"){
  250.                     var b = window.external.ContextAttributes(i).Values.toArray();
  251.                 }
  252.             }
  253.         }
  254.         catch(e){}
  255.         
  256.         // Convert lang names to user-readable values
  257.         if (b != null ) {
  258.             
  259.             var listLength = b.length;
  260.             tempLangList = new Array(listLength);
  261.             
  262.             for (var i = 0, end = listLength; i < end; ++i ) {
  263.                 
  264.                 // Map attrib Value to attrib Display values for select langs, otherwise use as is.
  265.                 switch (b[i].toUpperCase()) {
  266.                     case "VB" :
  267.                         tempLangList[i] = "Visual Basic";
  268.                         break;
  269.                     case "VC" :
  270.                         tempLangList[i] = "C++";
  271.                         break;
  272.                     case "CSHARP" :
  273.                         tempLangList[i] = "C#";
  274.                         break;
  275.                     case "JSCRIPT" :
  276.                         tempLangList[i] = "JScript";
  277.                         break;
  278.                     case "VBSCRIPT" :
  279.                         tempLangList[i] = "VBScript";
  280.                         break;
  281.                     case "VJ#" :
  282.                         tempLangList[i] = "VJ#";
  283.                         break;
  284.                     default :
  285.                         tempLangList[i] = b[i];
  286.                         break;
  287.                 }
  288.             }
  289.         }
  290.     }
  291.  
  292.     // (Try 3) Check to see what the help filter is set to.
  293.     if (tempLangList == null){
  294.         // Could result in a multi-item langList
  295.         
  296.         var filterList = null;
  297.         
  298.         try {filterList = window.external.Help.FilterQuery.toUpperCase();}
  299.         catch(e){}
  300.         
  301.         if ( filterList != null ) {
  302.             
  303.             // Add to list if in filter
  304.             var langString = "";
  305.             
  306.             if (filterList.indexOf("VISUAL BASIC") != -1){
  307.                 langString += (langString == "") ? "Visual Basic" : ",Visual Basic";
  308.             }
  309.             if (filterList.indexOf("VISUAL C++") != -1){
  310.                 langString += (langString == "") ? "C++" : ",C++";
  311.             }
  312.             if (filterList.indexOf("C#") != -1){
  313.                 langString += (langString == "") ? "C#" : ",C#";
  314.             }
  315.  
  316.             if (filterList.indexOf("JSCRIPT") != -1){
  317.                 langString += (langString == "") ? "JScript" : ",JScript";
  318.             }
  319.             if (filterList.indexOf("VBSCRIPT") != -1){
  320.                 langString += (langString == "") ? "VBScript" : ",VBScript";
  321.             }
  322.  
  323.             if (filterList.indexOf("VJ#") != -1){
  324.                 langString += (langString == "") ? "VJ#" : ",VJ#";
  325.             }
  326.  
  327.             if (langString != "") {
  328.                 tempLangList = langString.split(",");
  329.             }
  330.             
  331.         }
  332.         
  333.     }
  334.     
  335.     
  336.     // (Try 4) Read the persisted value 
  337.     if (tempLangList == null){
  338.         // Results in a single-item langList
  339.         if ( this.cook != null ) {
  340.             if (this.cook.getValue("lang.all") != "1") {
  341.                 var lang = this.cook.getValue("lang");
  342.                 var found = false;
  343.                 for (var i = 0, end = docLangList.length; ((i < end) && (!found)); ++i) {
  344.                     if (docLangList[i] == lang) {
  345.                         // Read if found in the current document
  346.                         found = true;
  347.                         tempLangList = new Array(1);
  348.                         tempLangList[0] = lang;
  349.                     }
  350.                 }
  351.             }
  352.         }
  353.     }
  354.     
  355.  
  356.     // Create the list of filterable languages for this context
  357.     if (tempLangList == null) {
  358.         // No curLang
  359.         this.showAll = true;
  360.  
  361.     } else {
  362.         // Add langs to the current lang list if found in the docLangList
  363.  
  364.         var foundCount = 0;
  365.         // (1) Find how many match
  366.         for (var i = 0, endOuter = tempLangList.length; i < endOuter; ++i ) {
  367.             var testLang = tempLangList[i].toLowerCase();
  368.             for (var j = 0, endInner = docLangList.length; j < endInner; ++j ) {
  369.                 if (testLang == docLangList[j].toLowerCase()) {
  370.                     ++foundCount;
  371.                 }
  372.             } 
  373.         } 
  374.         
  375.         if (foundCount > 0) {
  376.  
  377.             // (2) Allocate this.langList and add the found langs to the array
  378.             this.langList = new Array(foundCount);
  379.             var k = 0;
  380.             for (var i = 0, endOuter = tempLangList.length; i < endOuter; ++i ) {
  381.                 var testLang = tempLangList[i].toLowerCase();
  382.                 for (var j = 0, endInner = docLangList.length; j < endInner; ++j ) {
  383.                     if (testLang == docLangList[j].toLowerCase()) {
  384.                         this.langList[k++] = docLangList[j];
  385.                     }
  386.                 } 
  387.             } 
  388.             
  389.             // Sort the list
  390.             this.langList = this.langList.sort();
  391.  
  392.             // There is a curLang
  393.             this.showAll = false;
  394.         }
  395.  
  396.     }
  397.  
  398.     return;
  399. }
  400.  
  401.  
  402.  
  403. function declareFilterTopicForLang(langName, saveLang){
  404.         
  405.     // Have something to filter on
  406.     if (langName == null) {
  407.         
  408.         if (this.langList == null) {
  409.             // Show all if no langs were found that have subsections defined in the topic
  410.             this.showAll = true;
  411.             unfilterLang();
  412.             
  413.         } else {
  414.  
  415.             // Show all context-specific langs
  416.             // NOTE: A language would not appear in this.langList unless 
  417.             //   it was somewhere on the topic.
  418.             this.showAll = false;
  419.             resetLangBlocks();
  420.             var isMultiLang = (this.langList.length > 1);
  421.             for (var i = 0, end = this.langList.length; i < end; ++i ) {
  422.                 filterLang(this.langList[i], isMultiLang);
  423.             }
  424.         }
  425.         
  426.     } else {
  427.         // Show only the specified lang
  428.         this.showAll = false;
  429.         resetLangBlocks();
  430.         filterLang(langName, false);
  431.     }
  432.     
  433.     // Always persist the lang setting when requested by the user
  434.     if (saveLang && isLangPersistable(langName)) {
  435.         if (this.cook != null) {
  436.             this.cook.putValue('lang', langName);
  437.             this.cook.putValue('lang.all', '');
  438.         }
  439.     }
  440.  
  441.     return;
  442. }
  443.  
  444.  
  445. function declareUnfilterTopicForLang(saveLang){
  446.  
  447.     this.showAll = true;
  448.     
  449.     if (saveLang) {
  450.         if (this.cook != null) {
  451.             this.cook.putValue('lang.all', '1');
  452.         }
  453.     }
  454.  
  455.     unfilterLang();
  456.     
  457.     return;
  458. }
  459.  
  460.  
  461. function declareCurLangListToString() {
  462. // Creates a comma-space dilimited display string of the langs for use in the banner heading
  463.     var outString;
  464.     if ( this.langList == null ) {
  465.         outString = "";
  466.     }
  467.     else {
  468.         outString = this.langList[0];
  469.         var i = 1;
  470.         while ( i < this.langList.length ) {
  471.             outString += ", " + this.langList[i++];
  472.         }
  473.     }
  474.         
  475.     return outString;
  476. }
  477.  
  478.  
  479.  
  480.  
  481. // Bind the CurLangList member function declarations to the function prototype property
  482. CurLangList.prototype.filterTopicForLang = declareFilterTopicForLang;
  483. CurLangList.prototype.unfilterTopicForLang = declareUnfilterTopicForLang;
  484. CurLangList.prototype.toString = declareCurLangListToString;
  485.  
  486.  
  487.  
  488.  
  489. // ------------------ Language filtering accessory functions ---------------------------
  490.  
  491.  
  492. function isLangPersistable(langName) {
  493.     
  494.     var pass = false;
  495.     var testLang = langName.toLowerCase();
  496.     
  497.     switch ( testLang ) {
  498.         // Fall through to default: If listed here is persistable
  499.         case "visual basic":
  500.         case "c#":
  501.         case "c++":
  502.         case "jscript":
  503.         case "vj#":
  504.             pass = true;
  505.             break;
  506.         default:
  507.             pass = false;
  508.             break;
  509.     }
  510.     
  511.     return pass;
  512. }
  513.  
  514.  
  515.  
  516. function findLanguage(bookmark){
  517. // Find span associated with bookmark
  518.     var found = false
  519.     var aColl = document.all.tags("A");
  520.     for (i=0; i<aColl.length; i++){
  521.         if (aColl(i).name.toUpperCase()==bookmark.toUpperCase()){
  522.             var elem = null
  523.             for(t = 1; t<4; t++){
  524.                 elem = document.all(aColl(i).sourceIndex + t);
  525.                 if (elem.tagName.toUpperCase()=="SPAN")
  526.                     found = true;
  527.                     break;
  528.             }
  529.             break;
  530.         }
  531.     }
  532. //if found, filter language
  533.     if (found){
  534.         var lang = elem.innerText
  535.         return lang.substring(lang.indexOf("[") + 1, lang.indexOf("]"));
  536.     }
  537. }
  538.  
  539.  
  540.  
  541. function initLangs() {
  542.     
  543.     // instantiates curLangs
  544.     
  545.     var hdr = document.all.hdr;
  546.     if (!hdr)
  547.         return;
  548.  
  549.     var langs = new Array;
  550.     var spans = document.all.tags("SPAN");
  551.     if (spans) {
  552.         var iElem = spans.length;
  553.         for (iElem = 0; iElem < spans.length; iElem++) {
  554.             var elem = spans[iElem];
  555.             if (elem.className == "lang") {
  556.  
  557.                 // Update the array of unique language names.
  558.                 var a = elem.innerText.split(",");
  559.                 for (var iTok = 0; iTok < a.length; iTok++) {
  560.                     if (a[iTok]=="[A]"){
  561.                         langs[0]="A";
  562.                         elem.parentElement.outerText="";
  563.                     }
  564.                     var m = a[iTok].match(/([A-Za-z].*[A-Za-z+#0-9])/);
  565.                     if (m) {
  566.                         var iLang = 0;
  567.                         while (iLang < langs.length && langs[iLang] < m[1])
  568.                             iLang++;
  569.                         if (iLang == langs.length || langs[iLang] != m[1]) {
  570.                             var before = langs.slice(0,iLang);
  571.                             var after = langs.slice(iLang);
  572.                             langs = before.concat(m[1]).concat(after);
  573.                         }
  574.                     }
  575.                 }
  576.             }
  577.         }
  578.     }
  579.  
  580.     if (langs.length > 0) {
  581.     
  582.         // No language button created in this case.
  583.         
  584.         var pres = document.all.tags("PRE");
  585.         if (pres) {
  586.             for (var iPre = 0; iPre < pres.length; iPre++)
  587.                 initPreElem(pres[iPre]);
  588.         }
  589.         
  590.         
  591.         // Instantiate curLangs
  592.         curLangs = new CurLangList(langs);
  593.  
  594.         // Add current DevLang to the heading
  595.         var iLim = document.body.all.length;
  596.         var head = null;
  597.         for (var i = 0; i < iLim; i++) {
  598.             var elem = document.body.all[i];
  599.             if (elem.tagName.match(/^(P)|(PRE)|([DOU]L)$/))
  600.                 break;
  601.             if (elem.tagName.match(/^H[1-6]$/)) {
  602.                 head = elem;
  603.                 head.insertAdjacentHTML('beforeEnd', '<SPAN CLASS=ilang></SPAN>');
  604.             }
  605.         }
  606.  
  607.         iLang = 0;
  608.         foundA = false;
  609.         while (iLang != langs.length){
  610.             if (langs[iLang]=="A")
  611.                 foundA = true;
  612.             iLang++;
  613.         }
  614.         if (!foundA)
  615.             // don't language button on
  616.             var td = hdr.insertCell(0);
  617.             
  618.         if (td) {
  619.             // Add the language button to the button bar.
  620.             td.className = "button1";
  621.             td.onkeyup = ieKey;
  622.             td.onkeypress = langMenu;
  623.             td.onclick = langMenu;
  624.             td.innerHTML = '<IMG id=button1 SRC="' + baseUrl + 'Filter1a.gif' + '" ALT="' +
  625.                 L_FilterTip_TEXT + '" BORDER=0 TABINDEX=0>';
  626.  
  627.             // Create the current lang selection menu.
  628.             var div = '<DIV ID="lang_menu" CLASS=langMenu onkeypress=ieKey><B>' + L_Language_TEXT + '</B><UL>';
  629.             for (var i = 0; i < langs.length; i++)
  630.                 div += '<LI><A HREF="" ONCLICK="chooseLang(this)">' + langs[i] + '</A><BR>';
  631.             div += '<LI><A HREF="" ONCLICK="chooseAll()">' + L_ShowAll_TEXT + '</A></UL></DIV>';
  632.             try{nsbanner.insertAdjacentHTML('afterEnd', div);}
  633.             catch(e){try{scrbanner.insertAdjacentHTML('afterEnd', div);}catch(e){}}
  634.         }
  635.     }
  636. }
  637.  
  638.  
  639. function initPreElem(pre){
  640.     var htm0 = pre.outerHTML;
  641.  
  642.     var reLang = /<span\b[^>]*class="?lang"?[^>]*>/i;
  643.     var iFirst = -1;
  644.     var iSecond = -1;
  645.  
  646.     iFirst = htm0.search(reLang);
  647.     if (iFirst >= 0) {
  648.         iPos = iFirst + 17;
  649.         iMatch = htm0.substr(iPos).search(reLang);
  650.         if (iMatch >= 0)
  651.             iSecond = iPos + iMatch;
  652.     }
  653.  
  654.     if (iSecond < 0) {
  655.         var htm1 = trimPreElem(htm0);
  656.         if (htm1 != htm0) {
  657.             pre.insertAdjacentHTML('afterEnd', htm1);
  658.             pre.outerHTML = "";
  659.         }
  660.     }
  661.     else {
  662.         var rePairs = /<(\w+)\b[^>]*><\/\1>/gi;
  663.  
  664.         var substr1 = htm0.substring(0,iSecond);
  665.         var tags1 = substr1.replace(/>[^<>]+(<|$)/g, ">$1");
  666.         var open1 = tags1.replace(rePairs, "");
  667.         open1 = open1.replace(rePairs, "");
  668.  
  669.         var substr2 = htm0.substring(iSecond);
  670.         var tags2 = substr2.replace(/>[^<>]+</g, "><");
  671.         var open2 = tags2.replace(rePairs, "");
  672.         open2 = open2.replace(rePairs, "");
  673.  
  674.         pre.insertAdjacentHTML('afterEnd', open1 + substr2);
  675.         pre.insertAdjacentHTML('afterEnd', trimPreElem(substr1 + open2));
  676.         pre.outerHTML = "";
  677.     }    
  678. }
  679.  
  680.  
  681. function trimPreElem(htm){
  682.     return htm.replace(/[ \r\n]*((<\/[BI]>)*)[ \r\n]*<\/PRE>/g, "$1</PRE><P></P>").replace(
  683.         /\w*<\/SPAN>\w*((<[BI]>)*)\r\n/g, "\r\n</SPAN>$1"
  684.         );
  685. }
  686.  
  687.  
  688. function getBlock(elem){
  689.     while (elem && elem.tagName.match(/^([BIUA]|(SPAN)|(CODE)|(TD))$/))
  690.         elem = elem.parentElement;
  691.     return elem;
  692. }
  693.  
  694.  
  695. function langMenu(){
  696.     bodyOnClick();
  697.     var btn = window.event.srcElement
  698.     if (btn.id=="button1"){
  699.     btn.src = btn.src.replace("a.gif", "c.gif");}
  700.  
  701.     window.event.returnValue = false;
  702.     window.event.cancelBubble = true;
  703.  
  704.     var div = document.all.lang_menu;
  705.     var lnk = window.event.srcElement;
  706.     if (div && lnk) {
  707.         var x = lnk.offsetLeft + lnk.offsetWidth - div.offsetWidth;
  708.         div.style.pixelLeft = (x < 0) ? 0 : x;
  709.         div.style.pixelTop = lnk.offsetTop + lnk.offsetHeight;
  710.         div.style.visibility = "visible";
  711.     }
  712. }
  713.  
  714.  
  715. function chooseLang(item){
  716.  
  717.     // Called from the Lang Menu onclick event
  718.     
  719.     window.event.returnValue = false;
  720.     window.event.cancelBubble = true;
  721.  
  722.     if (item != null) {
  723.         closeMenu();
  724.         var langName = item.innerText;
  725.         curLangs.filterTopicForLang(langName, true);
  726.     }
  727.     return;
  728. }
  729.  
  730.  
  731. function chooseAll(){
  732.  
  733.     // Called from the Lang Menu onclick event
  734.  
  735.     window.event.returnValue = false;
  736.     window.event.cancelBubble = true;
  737.  
  738.     closeMenu();
  739.  
  740.     if ( curLangs != null ) {
  741.         curLangs.unfilterTopicForLang(true);
  742.     }
  743.     
  744.     return;
  745. }
  746.  
  747.  
  748.  
  749.  
  750. function filterLang(langName, isMultiLang){
  751.     
  752.     // Call resetLangBlocks() first to reset
  753.     // Then call filterLang() repeatedly for each lang that needs to be filtered.
  754.     
  755.     var spans = document.all.tags("SPAN");
  756.     for (var i = 0; i < spans.length; i++) {
  757.         var elem = spans[i];
  758.         if (elem.className == "lang") {
  759.             var isMatch = filterMatch(elem.innerText, langName);
  760.             var block = getBlock(elem);
  761.             if (isMatch) {
  762.                 block.style.display = "block";
  763.             }
  764.             elem.style.display = isMultiLang ? "inline" : "none";
  765.  
  766.             if (block.tagName == "DT") {
  767.                 var next = getNext(block);
  768.                 if (next && next.tagName == "DD") {
  769.                     if (isMatch) {
  770.                         next.style.display = "block";
  771.                     }
  772.                 }
  773.             }
  774.             else if (block.tagName == "DIV") {
  775.                 block.className = "filtered2";
  776.             }
  777.             else if (block.tagName.match(/^H[1-6]$/)) {
  778.                 if (topicHeading(block)) {
  779.                     if (isMatch) {
  780.                         var tag = null;
  781.                         if (block.children && block.children.length) {
  782.                             tag = block.children[block.children.length - 1];
  783.                             if (tag.className == "ilang") {
  784.                                 tag.innerHTML = '  [' + langName + ']';
  785.                             }
  786.                         }
  787.                     }
  788.                 }
  789.                 else {
  790.                     var next = getNext(block);
  791.                     while (next && !next.tagName.match(/^(H[1-6])$/)) {
  792.                         if (next.tagName =="DIV"){
  793.                             if (next.className.toUpperCase() != "TABLEDIV") break;
  794.                         }
  795.                         if (isMatch) {
  796.                             next.style.display = "block";
  797.                         }
  798.                         next = getNext(next);
  799.                     }
  800.                 }
  801.             }
  802.         }
  803.         else if (elem.className == "ilang") {
  804.             var block = getBlock(elem);
  805.             if (block.tagName == "H1") {
  806.                 if (isMultiLang) {
  807.                     elem.innerHTML = '  [' + curLangs.toString() + ']';
  808.                 } else {
  809.                     elem.innerHTML = '  [' + langName + ']';
  810.                 }
  811.             }
  812.         }
  813.     }
  814.     resizeBan();
  815.     
  816.     return;
  817. }
  818.  
  819.  
  820. function unfilterLang(){
  821.  
  822.     var spans = document.all.tags("SPAN");
  823.     for (var i = 0; i < spans.length; i++) {
  824.         var elem = spans[i];
  825.         if (elem.className == "lang") {
  826.             var block = getBlock(elem);
  827.             block.style.display = "block";
  828.             elem.style.display = "inline";
  829.  
  830.             if (block.tagName == "DT") {
  831.                 var next = getNext(block);
  832.                 if (next && next.tagName == "DD")
  833.                     next.style.display = "block";
  834.             }
  835.             else if (block.tagName == "DIV") {
  836.                 block.className = "filtered";
  837.             }
  838.             else if (block.tagName.match(/^H[1-6]$/)) {
  839.                 if (topicHeading(block)) {
  840.                     var tag = null;
  841.                     if (block.children && block.children.length) {
  842.                         tag = block.children[block.children.length - 1];
  843.                         if (tag && tag.className == "ilang")
  844.                             tag.innerHTML = "";
  845.                     }
  846.                 }
  847.                 else {
  848.                     var next = getNext(block);
  849.                     while (next && !next.tagName.match(/^(H[1-6])$/)) {
  850.                         if (next.tagName =="DIV"){
  851.                             if (next.className.toUpperCase() != "TABLEDIV") break;
  852.                         }
  853.                         next.style.display = "block";
  854.                         next = getNext(next);
  855.                     }
  856.                 }
  857.             }
  858.         }
  859.         else if (elem.className == "ilang") {
  860.             elem.innerHTML = "";
  861.         }
  862.     }
  863.     resizeBan();
  864.     
  865.     return;
  866. }
  867.  
  868. function resetLangBlocks(){
  869.     // Hides all lang blocks to reset display.
  870.     // Call before filterLang(), which selectively enables.
  871.  
  872.     var spans = document.all.tags("SPAN");
  873.     for (var i = 0; i < spans.length; i++) {
  874.         var elem = spans[i];
  875.         if (elem.className == "lang") {
  876.             var block = getBlock(elem);
  877.             block.style.display = "none";
  878.             elem.style.display = "inline";
  879.  
  880.             if (block.tagName == "DT") {
  881.                 var next = getNext(block);
  882.                 if (next && next.tagName == "DD")
  883.                     next.style.display = "none";
  884.             }
  885.             else if (block.tagName == "DIV") {
  886.                 block.className = "filtered";
  887.             }
  888.             else if (block.tagName.match(/^H[1-6]$/)) {
  889.                 if (topicHeading(block)) {
  890.                     var tag = null;
  891.                     if (block.children && block.children.length) {
  892.                         tag = block.children[block.children.length - 1];
  893.                         if (tag && tag.className == "ilang")
  894.                             tag.innerHTML = "";
  895.                     }
  896.                 }
  897.                 else {
  898.                     var next = getNext(block);
  899.                     while (next && !next.tagName.match(/^(H[1-6])$/)) {
  900.                         if (next.tagName =="DIV"){
  901.                             if (next.className.toUpperCase() != "TABLEDIV") break;
  902.                         }
  903.                         next.style.display = "none";
  904.                         next = getNext(next);
  905.                     }
  906.                 }
  907.             }
  908.         }
  909.         else if (elem.className == "ilang") {
  910.             elem.innerHTML = "";
  911.         }
  912.     }
  913.     resizeBan();
  914.     
  915.     return;
  916. }
  917.  
  918.  
  919.  
  920.  
  921.  
  922. function closeMenu(){
  923.     var div = document.all.lang_menu;
  924.     if (div && div.style.visibility != "hidden") {
  925.         var lnk = document.activeElement;
  926.         if (lnk && lnk.tagName == "A")
  927.             lnk.blur();
  928.  
  929.         div.style.visibility = "hidden";
  930.     }
  931. }
  932.  
  933.  
  934. function getNext(elem){
  935.     for (var i = elem.sourceIndex + 1; i < document.all.length; i++) {
  936.         var next = document.all[i];
  937.         if (!elem.contains(next))
  938.             return next;
  939.     }
  940.     return null;
  941. }
  942.  
  943.  
  944. function filterMatch(text, name){
  945.     var a = text.split(",");
  946.     for (var iTok = 0; iTok < a.length; iTok++) {
  947.         var m = a[iTok].match(/([A-Za-z].*[A-Za-z+#0-9])/);
  948.         if (m && m[1] == name)
  949.             return true;
  950.     }
  951.     return false;
  952. }
  953.  
  954.  
  955. function topicHeading(head){
  956.     try{var iLim = nstext.children.length;
  957.     Section = nstext;}
  958.     catch(e){try{var iLim = scrtext.children.length;
  959.         Section = scrtext;}
  960.         catch(e){var iLim = document.body.children.length;
  961.         Section = document.body;
  962.         }
  963.     }
  964.     var idxLim = head.sourceIndex;
  965.     for (var i = 0; i < iLim; i++) {
  966.         var elem = Section.children[i];
  967.         if (elem.sourceIndex < idxLim) {
  968.             if (elem.tagName.match(/^(P)|(PRE)|([DOU]L)$/))
  969.                 return false;
  970.         }
  971.         else
  972.             break;
  973.     }
  974.     return true;
  975. }
  976.  
  977.  
  978. // ****************************************************************************
  979. // *                         Clipboard Processing                             *
  980. // ****************************************************************************
  981.  
  982. function procCodeSelection() {
  983.     
  984.     try {
  985.         var oRange = document.selection.createRange();
  986.         
  987.         if (document.selection.type != "none") {
  988.         
  989.             var sMsg = "Nothing selected.";
  990.             var oParent = oRange.parentElement();
  991.             var sParentName = oParent.tagName;
  992.             var sClassValue = oParent.getAttribute("className", 0);
  993.             
  994.             if ((sParentName != null) && (sClassValue != null)) {
  995.                 if ((sParentName.toLowerCase() == "pre") && (sClassValue.toLowerCase() == "code")) {
  996.  
  997.                     var re = /\s*$/gi;
  998.                     var r = oRange.text.replace(re, "\r\n");
  999.                     
  1000.                     if (r != null) {
  1001.                         window.event.returnValue = false;
  1002.                         window.clipboardData.setData("Text", r);
  1003.                     }
  1004.                 }
  1005.             }
  1006.         }
  1007.     } 
  1008.     catch(e){}
  1009.     
  1010.     return;
  1011. }
  1012.  
  1013. // ****************************************************************************
  1014. // *                      Reftips (parameter popups)                          *
  1015. // ****************************************************************************
  1016.  
  1017. function initReftips(){
  1018.     var DLs = document.all.tags("DL");
  1019.     var PREs = document.all.tags("PRE");
  1020.     if (DLs && PREs) {
  1021.         var iDL = 0;
  1022.         var iPRE = 0;
  1023.         var iSyntax = -1;
  1024.         for (var iPRE = 0; iPRE < PREs.length; iPRE++) {
  1025.             if (PREs[iPRE].className == "syntax") {
  1026.                 while (iDL < DLs.length && DLs[iDL].sourceIndex < PREs[iPRE].sourceIndex)
  1027.                     iDL++;            
  1028.                 if (iDL < DLs.length) {
  1029.                     initSyntax(PREs[iPRE], DLs[iDL]);
  1030.                     iSyntax = iPRE;
  1031.                 }
  1032.                 else
  1033.                     break;
  1034.             }
  1035.         }
  1036.  
  1037.         if (iSyntax >= 0) {
  1038.             var last = PREs[iSyntax];
  1039.             if (last.parentElement.tagName == "DIV") last = last.parentElement;                        last.insertAdjacentHTML('afterEnd','<DIV ID=reftip CLASS=reftip STYLE="position:absolute;visibility:hidden;overflow:visible;"></DIV>');
  1040.         }
  1041.     }
  1042. }
  1043.  
  1044.  
  1045. function initSyntax(pre, dl){
  1046.     var strSyn = pre.outerHTML;
  1047.     var ichStart = strSyn.indexOf('>', 0) + 1;
  1048.     var terms = dl.children.tags("DT");
  1049.     if (terms) {
  1050.         for (var iTerm = 0; iTerm < terms.length; iTerm++) {
  1051.             if (terms[iTerm].innerHTML.indexOf("<!--join-->")!=-1){
  1052.                 var word = terms[iTerm].innerText.replace(/\s$/, "");
  1053.                 var ichMatch = findTerm(strSyn, ichStart, word);
  1054.                 if (ichMatch < 1){
  1055.                     word = word.replace(/\s/, " ")
  1056.                     ichMatch = findTerm(strSyn, ichStart, word);
  1057.                 }
  1058.                 while (ichMatch > 0) {
  1059.                     var strTag = '<A HREF="" ONCLICK="showTip(this)" CLASS="synParam">' + word + '</A>';
  1060.  
  1061.                     strSyn =
  1062.                         strSyn.slice(0, ichMatch) +
  1063.                         strTag +
  1064.                         strSyn.slice(ichMatch + word.length);
  1065.                     ichMatch = findTerm(strSyn, ichMatch + strTag.length, word);
  1066.                 }
  1067.                 
  1068.             }
  1069.         }
  1070.         for (var iTerm = 0; iTerm < terms.length; iTerm++) {
  1071.             if (terms[iTerm].innerHTML.indexOf("<!--join-->")==-1){
  1072.             var words = terms[iTerm].innerText.replace(/\[.+\]/g, " ").replace(/,/g, " ").split(" ");
  1073.                 var htm = terms[iTerm].innerHTML;
  1074.                 for (var iWord = 0; iWord < words.length; iWord++) {
  1075.                     var word = words[iWord];
  1076.  
  1077.                     if (word.length > 0 && htm.indexOf(word, 0) < 0)
  1078.                         word = word.replace(/:.+/, "");
  1079.  
  1080.                     if (word.length > 0) {
  1081.                         var ichMatch = findTerm(strSyn, ichStart, word);
  1082.                         while (ichMatch > 0) {
  1083.                             if (!isLinkText(strSyn.substring(ichMatch))){
  1084.                                 var strTag = '<A HREF="" ONCLICK="showTip(this)" CLASS="synParam">' + word + '</A>';
  1085.  
  1086.                                 strSyn =
  1087.                                     strSyn.slice(0, ichMatch) +
  1088.                                     strTag +
  1089.                                     strSyn.slice(ichMatch + word.length);
  1090.  
  1091.                                 ichMatch = findTerm(strSyn, ichMatch + strTag.length, word);
  1092.                             }
  1093.                             else ichMatch = findTerm(strSyn, ichMatch + word.length, word);
  1094.                         }
  1095.                     }
  1096.                 }
  1097.             }
  1098.         }
  1099.     }
  1100.  
  1101.     // Replace the syntax block with our modified version.
  1102.     pre.outerHTML = strSyn;
  1103. }
  1104.  
  1105.  
  1106. function findTerm(strSyn, ichPos, strTerm)
  1107. {
  1108.     var ichMatch = strSyn.indexOf(strTerm, ichPos);
  1109.     while (ichMatch >= 0) {
  1110.         var prev = (ichMatch == 0) ? '\0' : strSyn.charAt(ichMatch - 1);
  1111.         var next = strSyn.charAt(ichMatch + strTerm.length);
  1112.         if (!isalnum(prev) && !isalnum(next) && !isInTag(strSyn, ichMatch)) {
  1113.             var ichComment = strSyn.indexOf("/*", ichPos);
  1114.             while (ichComment >= 0) {
  1115.                 if (ichComment > ichMatch) { 
  1116.                     ichComment = -1;
  1117.                     break; 
  1118.                 }
  1119.                 var ichEnd = strSyn.indexOf("*/", ichComment);
  1120.                 if (ichEnd < 0 || ichEnd > ichMatch)
  1121.                     break;
  1122.                 ichComment = strSyn.indexOf("/*", ichEnd);
  1123.             }
  1124.             if (ichComment < 0) {
  1125.                 ichComment = strSyn.indexOf("//", ichPos);
  1126.                 var newPos = 0;
  1127.                 if (ichComment >= 0) {
  1128.                     while (isInTag(strSyn, ichComment)) { //checks to see if the comment is in a tag (and thus part of a URL)
  1129.                         newPos = ichComment + 1;
  1130.                         ichComment = strSyn.indexOf("//", newPos);
  1131.                         if (ichComment < 0) 
  1132.                             break;
  1133.                     }
  1134.                     while (ichComment >= 0) {
  1135.                         if (ichComment > ichMatch) {
  1136.                             ichComment = -1;
  1137.                             break; 
  1138.                         }
  1139.                         var ichEnd = strSyn.indexOf("\n", ichComment);
  1140.                         if (ichEnd < 0 || ichEnd > ichMatch)
  1141.                             break;
  1142.                         ichComment = strSyn.indexOf("//", ichEnd);
  1143.                     }
  1144.                 }
  1145.             }
  1146.             if (ichComment < 0)
  1147.                 break;
  1148.         }
  1149.         ichMatch = strSyn.indexOf(strTerm, ichMatch + strTerm.length);
  1150.     }
  1151.     return ichMatch;
  1152. }
  1153. function isLinkText(strHtml){
  1154.     return strHtml.indexOf("<")==strHtml.toLowerCase().indexOf("<\/a>");
  1155. }
  1156.  
  1157. function isInTag(strHtml, ichPos)
  1158. {
  1159.     return strHtml.lastIndexOf('<', ichPos) >
  1160.         strHtml.lastIndexOf('>', ichPos);
  1161. }
  1162.  
  1163.  
  1164. function isalnum(ch){
  1165.     return ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || (ch >= '0' && ch <= '9') || (ch == '_') || (ch == '-'));
  1166. }
  1167.  
  1168.  
  1169. function showTip(link){
  1170.     bodyOnClick();
  1171.     var tip = document.all.reftip;
  1172.     if (!tip || !link)
  1173.         return;
  1174.  
  1175.     window.event.returnValue = false;
  1176.     window.event.cancelBubble = true;
  1177.  
  1178.     // Hide the tip if necessary and initialize its size.
  1179.     tip.style.visibility = "hidden";
  1180.     tip.style.pixelWidth = 260;
  1181.     tip.style.pixelHeight = 24;
  1182.  
  1183.     // Find the link target.
  1184.     var term = null;
  1185.     var def = null;
  1186.     var DLs = document.all.tags("DL");
  1187.     for (var iDL = 0; iDL < DLs.length; iDL++) {
  1188.         if (DLs[iDL].sourceIndex > link.sourceIndex) {
  1189.             var dl = DLs[iDL];
  1190.             var iMax = dl.children.length - 1;
  1191.             for (var iElem = 0; iElem < iMax; iElem++) {
  1192.                 var dt = dl.children[iElem];
  1193.                 if (dt.tagName == "DT" && dt.style.display != "none") {
  1194.                     if (findTerm(dt.innerText, 0, link.innerText) >= 0) {
  1195.                         var dd = dl.children[iElem + 1];
  1196.                         if (dd.tagName == "DD") {
  1197.                             term = dt;
  1198.                             def = dd;
  1199.                         }
  1200.                         break;
  1201.                     }
  1202.                 }
  1203.             }
  1204.             break;
  1205.         }
  1206.     }
  1207.  
  1208.     if (def) {
  1209.  
  1210.         var popupText = null;
  1211.  
  1212.         for (var ddIdx = 0, ddEnd = def.children.length; ddIdx < ddEnd; ++ddIdx) {
  1213.  
  1214.             var tmp = def.children[ddIdx].tagName.toLowerCase();
  1215.             if (tmp == "span") {
  1216.                 popupText = def.children[ddIdx].innerHTML;
  1217.                 break;
  1218.             }
  1219.         }
  1220.  
  1221.         if (popupText == null) {
  1222.  
  1223.                   popupText = def.innerHTML;
  1224.  
  1225.                   // This was modified to fix issues with oversized popups. Limited to one sentence..
  1226.  
  1227.                   var isLink = true;
  1228.                   var intIndex = 0;
  1229.                   var strLink = null;
  1230.  
  1231.                   while(isLink == true) {
  1232.  
  1233.                     intIndex = popupText.indexOf('.', intIndex);
  1234.                     strLink = popupText.substr(intIndex + 1, 3);
  1235.                           
  1236.                     if(strLink=='htm' || strLink=='mic' || strLink=='com')
  1237.                       intIndex = intIndex + 1;
  1238.                     else
  1239.                       isLink = false;
  1240.  
  1241.                   }
  1242.  
  1243.                   popupText = popupText.substr(0, intIndex + 1);
  1244.  
  1245.         }
  1246.  
  1247.         window.linkElement = link;
  1248.         window.linkTarget = term;
  1249.         tip.innerHTML = '<DL><DT>' + term.innerHTML + '</DT><DD>' + popupText + '</DD></DL>';
  1250.         window.setTimeout("moveTip()", 0);
  1251.     }
  1252. }
  1253.  
  1254.  
  1255. function jumpParam(){
  1256.     hideTip();
  1257.  
  1258.     window.linkTarget.scrollIntoView();
  1259.     document.body.scrollLeft = 0;
  1260.  
  1261.     flash(3);
  1262. }
  1263.  
  1264.  
  1265. function flash(c){
  1266.     window.linkTarget.style.background = (c & 1) ? "#CCCCCC" : "";
  1267.     if (c)
  1268.         window.setTimeout("flash(" + (c-1) + ")", 200);
  1269. }
  1270.  
  1271.  
  1272. function moveTip(){
  1273.     var tip = document.all.reftip;
  1274.     var link = window.linkElement;
  1275.     if (!tip || !link)
  1276.         return; //error
  1277.  
  1278.     var w = tip.offsetWidth;
  1279.     var h = tip.offsetHeight;
  1280.  
  1281.     if (w > tip.style.pixelWidth) {
  1282.         tip.style.pixelWidth = w;
  1283.         window.setTimeout("moveTip()", 0);
  1284.         return;
  1285.     }
  1286.  
  1287.     var maxw = document.body.clientWidth-20;
  1288.     var maxh = document.body.clientHeight - 200;
  1289.  
  1290.     if (h > maxh) {
  1291.         if (w < maxw) {
  1292.             w = w * 3 / 2;
  1293.             tip.style.pixelWidth = (w < maxw) ? w : maxw;
  1294.             window.setTimeout("moveTip()", 0);
  1295.             return;
  1296.         }
  1297.     }
  1298.  
  1299.     var x,y;
  1300.  
  1301.     var linkLeft = link.offsetLeft - document.body.scrollLeft;
  1302.     var linkRight = linkLeft + link.offsetWidth;
  1303.  
  1304.     try{var linkTop = link.offsetTop - nstext.scrollTop + nstext.offsetTop;}
  1305.     catch(e){var linkTop = link.offsetTop;}
  1306.     var linkBottom = linkTop + link.offsetHeight + 4;
  1307.  
  1308.     var cxMin = link.offsetWidth - 24;
  1309.     if (cxMin < 16)
  1310.         cxMin = 16;
  1311.  
  1312.     if ((linkLeft + cxMin + w <= maxw)&&(h+linkTop <= maxh + 150)) {
  1313.         x = linkLeft;
  1314.         y = linkBottom;
  1315.     }
  1316.     if ((linkLeft + cxMin + w <= maxw)&&(h+linkTop > maxh + 150)) {
  1317.         x = maxw - w;
  1318.         if (x > linkRight + 8)
  1319.             x = linkRight + 8;
  1320.         x = linkLeft;
  1321.         y = linkTop-h;
  1322.     }
  1323.     if ((linkLeft + cxMin + w >= maxw)&&(h+linkTop <= maxh + 150)) {
  1324.         x = linkRight - w;
  1325.         if (x < 0)
  1326.             x = 0;
  1327.         y=linkBottom;
  1328.     }
  1329.     if ((linkLeft + cxMin + w >= maxw)&&(h+linkTop > maxh + 150)) {
  1330.         x = linkRight - w;
  1331.         if (x < 0)
  1332.             x = 0;
  1333.         y = linkTop-h;
  1334.         if (y<0)
  1335.             y = 0;
  1336.     }
  1337.     link.style.background = "#CCCCCC";
  1338.     tip.style.pixelLeft = x + document.body.scrollLeft;
  1339.     tip.style.pixelTop = y;
  1340.     tip.style.visibility = "visible";
  1341. }
  1342.  
  1343.  
  1344. function hideTip(){
  1345.     if (window.linkElement) {
  1346.         window.linkElement.style.background = "";
  1347.         window.linkElement = null;
  1348.     }
  1349.  
  1350.     var tip = document.all.reftip;
  1351.     if (tip) {
  1352.         tip.style.visibility = "hidden";
  1353.         tip.innerHTML = "";
  1354.     }
  1355. }
  1356.  
  1357.  
  1358. function beginsWith(s1, s2){
  1359.     // Does s1 begin with s2?
  1360.     return s1.toLowerCase().substring(0, s2.length) == s2.toLowerCase();
  1361. }
  1362.  
  1363.  
  1364. // ****************************************************************************
  1365. // *                           See Also popups                                *
  1366. // ****************************************************************************
  1367.  
  1368. function initSeeAlso(){
  1369.     var hdr = document.all.hdr;
  1370.     if (!hdr)
  1371.         return;
  1372.  
  1373.     var divS = new String;
  1374.     var divR = new String;
  1375.     var heads = document.all.tags("H4");
  1376.     if (heads) {
  1377.         for (var i = 0; i < heads.length; i++) {
  1378.             var head = heads[i];
  1379.             var txt = head.innerText;
  1380.             if (beginsWith(txt, L_SeeAlso_TEXT) || beginsWith(txt, US_See_Also)) {
  1381.                 divS += head.outerHTML;
  1382.                 var next = getNext(head);
  1383.                 while (next && !next.tagName.match(/^(H[1-4])|(DIV)$/)) {
  1384.                     divS += next.outerHTML;
  1385.                     next = getNext(next);
  1386.                 }
  1387.                 while ((divS.indexOf("<MSHelp:ktable")!=-1)&&(divS.indexOf("<\/MSHelp:ktable>")!=-1)){
  1388.                     divS=divS.substring(0, divS.indexOf("<MSHelp:ktable")) + divS.substring(divS.indexOf("<\/MSHelp:ktable>")+16);
  1389.                 }
  1390.             }
  1391.             else if (beginsWith(txt, L_Requirements_TEXT) || beginsWith(txt, US_Requirements) || beginsWith(txt, L_QuickInfo_TEXT) || beginsWith(txt, US_QuickInfo)) {
  1392.                 divR += head.outerHTML;
  1393.                 var next = getNext(head);
  1394.                 var isValid = true;
  1395.                 while (isValid){
  1396.                     if (next && !next.tagName.match(/^(H[1-4])$/)){
  1397.                         if (next.tagName == "DIV" && next.outerHTML.indexOf("tablediv")==-1)
  1398.                                 isValid = false;
  1399.                         if (isValid){
  1400.                             divR += next.outerHTML;
  1401.                             next = getNext(next);
  1402.                         }
  1403.                     }
  1404.                     else
  1405.                         isValid = false;
  1406.                 }
  1407.             }
  1408.         }
  1409.     }
  1410.  
  1411.     var pos = getNext(hdr.parentElement);
  1412.     if (pos) {
  1413.         if (divR != "") {
  1414.             divR = '<DIV ID=rpop CLASS=sapop onkeypress=ieKey>' + divR + '</DIV>';
  1415.             var td = hdr.insertCell(0);
  1416.             if (td) {
  1417.                 td.className = "button1";
  1418.                 td.onclick = showRequirements;
  1419.                 td.onkeyup = ieKey;
  1420.                 td.onkeypress = showRequirements;
  1421.                 td.innerHTML = '<IMG id=button1 SRC="' + baseUrl + 'Requirements1a.gif' + '" ALT="' + L_Requirements_TEXT + '" BORDER=0 TABINDEX=0>';
  1422.                 if (advanced)
  1423.                     try{nsbanner.insertAdjacentHTML('afterEnd', divR);}
  1424.                     catch(e){try{scrbanner.insertAdjacentHTML('afterEnd', divR);}catch(e){}}
  1425.                 else
  1426.                     document.body.insertAdjacentHTML('beforeEnd', divR);
  1427.             }
  1428.         }
  1429.         if (divS != "") {
  1430.             divS = '<DIV ID=sapop CLASS=sapop onkeypress=ieKey>' + divS + '</DIV>';
  1431.             var td = hdr.insertCell(0);
  1432.             if (td) {
  1433.                 td.className = "button1";
  1434.                 td.onclick = showSeeAlso;
  1435.                 td.onkeyup = ieKey;
  1436.                 td.onkeypress = showSeeAlso;
  1437.                 td.innerHTML = '<IMG id=button1 SRC="' + baseUrl + 'SeeAlso1a.gif' + '" ALT="' + L_SeeAlso_TEXT + '" BORDER=0 TABINDEX=0>';
  1438.                 if (advanced)
  1439.                     try{nsbanner.insertAdjacentHTML('afterEnd', divS);}
  1440.                     catch(e){try{scrbanner.insertAdjacentHTML('afterEnd', divS);}catch(e){}}
  1441.                 else
  1442.                     document.body.insertAdjacentHTML('beforeEnd', divS);
  1443.             }
  1444.         }
  1445.     }
  1446. }
  1447.  
  1448. function resetButtons(){
  1449.     //unclick buttons...
  1450.     var btns = document.all.button1;
  1451.     if (btns) {
  1452.         if (btns.src!=null) btns.src=btns.src.replace("c.gif", "a.gif"); //if there is only one button.
  1453.         for (var i = 0; i < btns.length; i++){
  1454.             btns[i].src = btns[i].src.replace("c.gif", "a.gif");
  1455.         }
  1456.     }
  1457. }
  1458.  
  1459. function showSeeAlso(){
  1460.     bodyOnClick();
  1461.     var btn = window.event.srcElement
  1462.     if (btn.id=="button1"){
  1463.     btn.src = btn.src.replace("a.gif", "c.gif");}
  1464.  
  1465.     window.event.returnValue = false;
  1466.     window.event.cancelBubble = true;
  1467.  
  1468.     var div = document.all.sapop;
  1469.     var lnk = window.event.srcElement;
  1470.  
  1471.     if (div && lnk) {
  1472.         div.style.pixelTop = lnk.offsetTop + lnk.offsetHeight;
  1473.         div.style.visibility = "visible";
  1474.     }
  1475. }
  1476.  
  1477.  
  1478. function showRequirements(){
  1479.     bodyOnClick();
  1480.     var btn = window.event.srcElement
  1481.     if (btn.id=="button1"){
  1482.     btn.src = btn.src.replace("a.gif", "c.gif");}
  1483.  
  1484.     window.event.returnValue = false;
  1485.     window.event.cancelBubble = true;
  1486.  
  1487.     var div = document.all.rpop;
  1488.     var lnk = window.event.srcElement;
  1489.  
  1490.     if (div && lnk) {
  1491.         div.style.pixelTop = lnk.offsetTop + lnk.offsetHeight;
  1492.         div.style.visibility = "visible";
  1493.     }
  1494. }
  1495.  
  1496.  
  1497. function hideSeeAlso(){
  1498.     var div = document.all.sapop;
  1499.     if (div)
  1500.         div.style.visibility = "hidden";
  1501.  
  1502.     var div = document.all.rpop;
  1503.     if (div)
  1504.         div.style.visibility = "hidden";
  1505. }
  1506.  
  1507. function loadAll(){
  1508.     try {
  1509.         scrollPos = allHistory.getAttribute("Scroll");
  1510.     }
  1511.     catch(e){    }
  1512. }
  1513.  
  1514. function saveAll(){
  1515.     try{
  1516.         allHistory.setAttribute("Scroll",nstext.scrollTop);
  1517.     }
  1518.     catch(e){    }
  1519. }
  1520.  
  1521. // ****************************************************************************
  1522. // *                             Expand-Collapse                              *
  1523. // ****************************************************************************
  1524. /* keeping state requires the document to have the following tags... the meta tag may have to be before the body tag.
  1525.     <META NAME="save" CONTENT="history">
  1526.     <DIV id=sHistory class=saveHistory onsave="fnSave()" onload="fnLoad()"></DIV>
  1527. */
  1528.  
  1529. /* required in the css
  1530. div.saveHistory
  1531.     {
  1532.     behavior:url(#default#savehistory);
  1533.     }
  1534. */
  1535. function fnLoad(){
  1536.     var oArray = sHistory.getAttribute("sPersistState").split("|");
  1537.     if (oArray.length>0){
  1538.         var offset = oArray[0]-sHistory.sourceIndex;
  1539.         for(var i=1;i<oArray.length;i++){
  1540.             document.all[oArray[i]-offset].style.display="block";
  1541.             document.all[oArray[i]-(offset+2)].parentElement.all.tags('IMG')(0).src = baseUrl + "coc.gif";
  1542.         }
  1543.     document.all.ExPandAll.innerHTML=sHistory.getAttribute("sPersistStateAll");
  1544.     }
  1545. }
  1546. function fnSave(){
  1547.     var sArray="";
  1548.     for(var i=0;i<document.all.length;i++){
  1549.         oTrap=document.all[i];
  1550.         if((oTrap.tagName=="DIV")&&(oTrap.className=="expandBody")){
  1551.             if (oTrap.style.display == "block") {
  1552.                 if(sArray.length==0){
  1553.                     sArray=sHistory.sourceIndex + "|" + i;
  1554.                 }
  1555.                 else sArray+="|" + i;
  1556.             }
  1557.         }
  1558.     }
  1559.     sHistory.setAttribute("sPersistState",sArray);
  1560.     sHistory.setAttribute("sPersistStateAll", document.all.ExPandAll.innerHTML);
  1561. }
  1562. function makeExpandable(title, level){
  1563.     if (title!="")document.write("<a href=\"\#\" onClick='callExpand()' id=\"ExPand\" Class=\"expandLink" + level + "\"><IMG CLASS=\"ExPand\" SRC=\"" + baseUrl + "coe.gif\" HEIGHT=9 WIDTH=9 ALT=\"" + L_ExColl_TEXT + "\" BORDER=0> " + title + "</a><BR><div CLASS=\"expandBody\">");
  1564.     else document.write("<a href=\"\#\" id=\"ExPandAll\" onClick='callExpandAll()' Class=\"expandLink" + level + "\"><IMG CLASS=\"ExPandAll\" SRC=\"" + baseUrl + "coe.gif\" HEIGHT=9 WIDTH=9 ALT=\"" + L_ExColl_TEXT + "\" BORDER=0> " + L_ExpandAll_TEXT + "</A>");
  1565. }
  1566.  
  1567. function getImage(){
  1568.     for (var a = 0; a < 7; a++){
  1569.           if ((e.tagName != 'A') && (e.parentElement != null)){e = e.parentElement;}
  1570.         var elemImg = e;
  1571.         if(elemImg.tagName == 'A'){elemImg = e.all.tags('IMG')(0); break;}}
  1572. return elemImg;}
  1573.  
  1574. function callExpand(){
  1575.     //DO EXPAND/COLLAPSE
  1576.     e = window.event.srcElement;
  1577.     //PREVENTS NAVIGATION ON HREF TAGS
  1578.     event.returnValue = false;
  1579.  
  1580.     //FIND THE EXPAND/COLLAPSE PORTION AND ASCERTAIN BLOCK VS NONE
  1581.     var theDiv = GrabtheExpandDiv(e);
  1582.         
  1583.     //THIS PART WRITES THE PROPER IMAGE BESIDE THE TEXT
  1584.     if (theDiv.style.display == 'block'){
  1585.         var theImg = getImage(e);
  1586.         theImg.src = baseUrl + "coe.gif";
  1587.         theDiv.style.display = "none";}
  1588.     else {
  1589.         var theImg = getImage(e);
  1590.         theImg.src = baseUrl + "coc.gif";
  1591.         theDiv.style.display = "block";}
  1592. return;}
  1593.  
  1594. function GrabtheExpandDiv(e){
  1595. //FIND AREA TO EXPAND/COLLAPSE
  1596.     var theExpandDiv;
  1597.     for (var a = 0; a < 7; a++){
  1598.         var theTag = e.sourceIndex + e.children.length + a;
  1599.         theExpandDiv= document.all(theTag);
  1600.          if (((theExpandDiv.tagName == 'DIV') && ((theExpandDiv.className.toLowerCase().indexOf("expandbody")!=-1))) || theTag == document.all.length){break;}}
  1601. return theExpandDiv;
  1602. }
  1603.  
  1604. function callExpandAll(){
  1605.     e = window.event.srcElement;
  1606.     //PREVENTS NAVIGATION ON HREF TAGS
  1607.     event.returnValue = false;
  1608.     if (e.tagName=="IMG") e = e.parentElement;
  1609.     //Expand or Collapse?
  1610.     if (e.innerHTML.indexOf(L_ExpandAll_TEXT) != -1){eOrC="block"}else{eOrC="none"}
  1611.     if (eOrC=="block"){
  1612.         e.innerHTML="<IMG CLASS='ExPand' SRC=\"" + baseUrl + "coc.gif\" HEIGHT='9' WIDTH='9' ALT='" + L_ExColl_TEXT + "' BORDER='0'> " + L_CollapseAll_TEXT;}
  1613.     else{
  1614.         e.innerHTML="<IMG CLASS='ExPand' SRC=\"" + baseUrl + "coe.gif\" HEIGHT='9' WIDTH='9' ALT='" + L_ExColl_TEXT + "' BORDER='0'> " + L_ExpandAll_TEXT;}
  1615.     for (var a = 0; a < document.all.length; a++){ 
  1616.         e=document.all[a];
  1617.  
  1618.         if (e.id.indexOf('ExPand') != -1){
  1619.  
  1620.             if (e.id.indexOf('ExPandAll') == -1){
  1621.  
  1622.             var theDiv = GrabtheExpandDiv(e);
  1623.             if (eOrC == 'none'){
  1624.                 theImg = getImage(e);
  1625.                 theImg.src = baseUrl + "coe.gif";
  1626.                 theDiv.style.display = eOrC;}
  1627.             else {
  1628.                 theImg = getImage(e);
  1629.                 theImg.src = baseUrl + "coc.gif";
  1630.                 theDiv.style.display = eOrC;}
  1631.             }
  1632.         }
  1633.     }
  1634. return;}
  1635.  
  1636.  
  1637. // ****************************************************************************
  1638. // *                           Nonscrolling region                            *
  1639. // ****************************************************************************
  1640.  
  1641. function resizeBan(){
  1642. //resizes nonscrolling banner
  1643.     if (document.body.clientWidth==0) return;
  1644.     var oBanner= document.all.item("nsbanner");
  1645.     var oText= document.all.item("nstext");
  1646.     if (oText == null) return;
  1647.     var oBannerrow1 = document.all.item("bannerrow1");
  1648.     var oTitleRow = document.all.item("titlerow");
  1649.     if (oBannerrow1 != null){
  1650.         var iScrollWidth = bodyID.scrollWidth;
  1651.         oBannerrow1.style.marginRight = 0 - iScrollWidth;
  1652.     }
  1653.     if (oTitleRow != null){
  1654.         oTitleRow.style.padding = "0px 10px 0px 22px; ";
  1655.     }
  1656.     if (oBanner != null){
  1657. //Uncomment the following 4 lines for slingshot
  1658. //        if (document.all.tags('iframe') !=null){
  1659. //        document.body.scroll = "yes"
  1660. //        return; 
  1661. //    }
  1662.         document.body.scroll = "no"
  1663.         oText.style.overflow= "auto";
  1664.          oBanner.style.width= document.body.offsetWidth - 2;
  1665.         oText.style.paddingRight = "20px"; // Width issue code
  1666.         oText.style.width= document.body.offsetWidth - 4;
  1667.         oText.style.top=0;  
  1668.         if (document.body.offsetHeight > oBanner.offsetHeight + 4)
  1669.                 oText.style.height= document.body.offsetHeight - (oBanner.offsetHeight + 4) 
  1670.         else oText.style.height=0
  1671.     }    
  1672.     try{nstext.setActive();} //allows scrolling from keyboard as soon as page is loaded. Only works in IE 5.5 and above.
  1673.     catch(e){}
  1674.     resetButtons();
  1675.  
  1676.  
  1677. function set_to_print(){
  1678. //breaks out of divs to print
  1679.  
  1680.     var i;
  1681.  
  1682.     if (window.text)document.all.text.style.height = "auto";
  1683.             
  1684.     for (i=0; i < document.all.length; i++){
  1685.         if (document.all[i].tagName == "BODY") {
  1686.             document.all[i].scroll = "yes";
  1687.             }
  1688.         if (document.all[i].id == "nsbanner") {
  1689.             document.all[i].style.margin = "0px 0px 0px 0px";
  1690.             document.all[i].style.width = "100%";
  1691.             }
  1692.         if (document.all[i].id == "nstext") {
  1693.             document.all[i].style.overflow = "visible";
  1694.             document.all[i].style.top = "5px";
  1695.             document.all[i].style.width = "100%";
  1696.             document.all[i].style.padding = "0px 10px 0px 30px";
  1697.             }
  1698. /*        if (document.all[i].tagName == "A") {
  1699.             document.all[i].outerHTML = "<A HREF=''>" + document.all[i].innerHTML + "</a>";
  1700.             }
  1701. */
  1702.         }
  1703. }
  1704.  
  1705.  
  1706. function reset_form(){
  1707. //returns to the div nonscrolling region after print
  1708.  
  1709.      document.location.reload();
  1710. }
  1711.  
  1712.  
  1713. // ****************************************************************************
  1714. // *                        Feedback & other footer links                     *
  1715. // ****************************************************************************
  1716.  
  1717. function sendfeedback(msdnid, alias){
  1718.     var url = location.href;
  1719.     var title = document.all.tags("TITLE")[0].innerText;
  1720.     var browser = navigator.appName + " " + navigator.appVersion
  1721.     location.href = "mailto:"+alias+"?subject=" + msdnid + "%20" + title + "&body=Topic%20ID:%20" + msdnid + "%0d%0aTopic%20Title:%20" + title + "%0d%0aURL:%20" + url + "%0d%0aBrowser:%20" + browser + "%0d%0a%0d%0aComments:%20";
  1722. }
  1723.  
  1724.  
  1725. function writemessagelink(){
  1726.     //Writes jump to PSS web site redirector
  1727.     //code tbd
  1728.     //Use L_MessageLink_TEXT variable from Localization Variables located at top of script.
  1729.     msdnid = arguments[0];
  1730.     href = "http://www.microsoft.com/contentredirect.asp?prd=vs&pver=7.0&id="+msdnid;
  1731.     document.writeln("<a href="+href+">"+L_MessageLink_TEXT+"</a>");
  1732. }
  1733.  
  1734.  
  1735. function writemailtolink(){
  1736.     //writes feedback link
  1737.     emailalias = arguments[0];
  1738.     contextid = arguments[1];
  1739.     topictitle = arguments[2];
  1740.  
  1741.     href = "mailto:"+emailalias+"?subject=Feedback%20on%20topic%20-%20"+topictitle+",%20URL%20-%20"+contextid;
  1742.     document.writeln("<a href="+href+">"+L_MailToLink_TEXT+"</a>");
  1743. }
  1744.  
  1745.  
  1746. // ****************************************************************************
  1747. // *                       NavFailPage Parameter Insertion                    *
  1748. // ****************************************************************************
  1749.  
  1750. function navfailpageparam() {
  1751.     var keyString = "keywords=";
  1752.     var idxString = "index=";
  1753.     var urlString = "url=";
  1754.     var query = window.location.search;
  1755.     var j = 0;
  1756.     var delim;
  1757.     var i = query.indexOf(keyString);
  1758.  
  1759.     document.write("<p>" + L_Keyword_TEXT + " <span id=keywordsSpan></span><br>");
  1760.     document.write(L_IndexMoniker_TEXT + " <span id=indexSpan></span><br>");
  1761.     document.write(L_URL_TEXT + " <span id=urlSpan></span></p>");
  1762.  
  1763.     if (i >= 0) {
  1764.         i += keyString.length;
  1765.         delim = query.charAt(i);
  1766.         j = query.indexOf(delim, i+1);
  1767.         if (j > 0) keywordsSpan.innerText = query.substring(i, j+1);
  1768.     }
  1769.  
  1770.     i = query.indexOf(idxString);
  1771.     if (i >= 0) {
  1772.         i += idxString.length;
  1773.         delim = query.charAt(i);
  1774.         j = query.indexOf(delim, i+1);
  1775.         if (j > 0) indexSpan.innerText = query.substring(i, j+1);
  1776.     }
  1777.  
  1778.     i = query.indexOf(urlString);
  1779.     if (i >= 0) {
  1780.         i += urlString.length;
  1781.         delim = query.charAt(i);
  1782.         j = query.indexOf(delim, i+1);
  1783.         if (j > 0) urlSpan.innerText = query.substring(i, j+1);
  1784.     }
  1785. }
  1786.  
  1787.  
  1788. //*********************************************************************************
  1789. // Persistence
  1790. // Comments: This was added to support the Persistence functionality.
  1791. //*********************************************************************************
  1792.  
  1793. var oTD,iTD;
  1794.  
  1795. //*********************************************************************************
  1796. // getChecklistState
  1797. // Purpose: Gets the status of the checklist.
  1798. // Comments: This was added to support the Persistence functionality.
  1799. //*********************************************************************************
  1800.  
  1801. function getChecklistState(){ 
  1802.  
  1803. var pageID= addID();
  1804.  
  1805. if (checklist.all== "[object]") {
  1806.   
  1807.   oTD=checklist.all.tags("INPUT");
  1808.   iTD= oTD.length;
  1809.  
  1810. }
  1811.  
  1812. else
  1813.  
  1814. {
  1815.   
  1816.   printing = true;
  1817.   isPersistent = false;
  1818.   return;
  1819.  
  1820. }
  1821.  
  1822. if (iTD == 0){
  1823.  
  1824.   printing = true;
  1825.   isPersistent = false;
  1826.   return;
  1827.  
  1828. }
  1829.  
  1830. lct = document.location + ".";
  1831. xax = 10;
  1832. xax = lct.indexOf("mk:@MSITStore");
  1833.  
  1834. if (xax != -1) {
  1835.   
  1836.   lct = "ms-its:" + lct.substring(14,lct.length-1);
  1837.   isPersistent = false;
  1838.   document.location.replace(lct);
  1839.   isPersistent = true;
  1840.  
  1841. }     
  1842.  
  1843. else
  1844.  
  1845. {      
  1846.   
  1847.   checklist.load("oXMLStore");
  1848.  
  1849. }
  1850.  
  1851. if (checklist.getAttribute("sPersist"+pageID+"0"))    
  1852.  
  1853.   for (i=0; i<iTD; i++){
  1854.  
  1855.     if (oTD[i].type =="checkbox" || oTD[i].type =="radio"){
  1856.     checkboxValue= checklist.getAttribute("sPersist"+pageID+i);
  1857.         
  1858.       if (checkboxValue=="yes") oTD[i].checked=true;
  1859.    
  1860.       else oTD[i].checked=false;
  1861.  
  1862.     }
  1863.     
  1864.     if (oTD[i].type =="text")              
  1865.     oTD[i].value= checklist.getAttribute("sPersist"+pageID+i);
  1866.  
  1867.   }
  1868.  
  1869. }
  1870.  
  1871.  
  1872.  
  1873. //****************************End of getChecklistState*****************************
  1874.  
  1875. //*********************************************************************************
  1876. // saveChecklistState
  1877. // Purpose: Saves the status of the checklist.
  1878. // Comments: This was added to support the Persistence functionality.
  1879. //*********************************************************************************
  1880.  
  1881. function saveChecklistState(){
  1882.  
  1883. var pageID= addID(); 
  1884.  
  1885. if (!isPersistent) return; 
  1886.  
  1887. for (i=0; i<iTD; i++){
  1888.  
  1889.     if (oTD[i].type =="checkbox" || oTD[i].type =="radio"){
  1890.  
  1891.       if (oTD[i].checked) checkboxValue="yes";
  1892.       else checkboxValue="no";
  1893.  
  1894.       checklist.setAttribute("sPersist"+pageID+i, checkboxValue);
  1895.       }
  1896.             
  1897.       if (oTD[i].type =="text")  
  1898.       checklist.setAttribute("sPersist"+pageID+i, oTD[i].value);
  1899.  
  1900.   }
  1901.  
  1902.   lct = document.location + ".";
  1903.   xax = 10;
  1904.   xax = lct.indexOf("mk:@MSITStore");
  1905.  
  1906.   if (xax != -1) {
  1907.  
  1908.     lct = "ms-its:" + lct.substring(14,lct.length-1);
  1909.     isPersistent = false;
  1910.     //document.location.replace(lct);
  1911.     isPersistent = true;
  1912.   }     
  1913.  
  1914.   else
  1915.   
  1916.   {
  1917.  
  1918.     checklist.save("oXMLStore");
  1919.  
  1920.   }
  1921.  
  1922. }
  1923.  
  1924. //***************************End of saveChecklistState*****************************
  1925.  
  1926.  
  1927. //*********************************************************************************
  1928. // addID 
  1929. // Purpose: Returns the context id.
  1930. // Comments: This was added to support the Persistence functionality.
  1931. //*********************************************************************************
  1932.  
  1933. function addID(){
  1934.  
  1935. var locID = document.location.href; 
  1936. var iHTM = locID.lastIndexOf(".htm");
  1937. var iName=locID.lastIndexOf("/");
  1938. locID = locID.substring(iName+1,iHTM);
  1939.     
  1940. return locID;
  1941.  
  1942. }
  1943.  
  1944. //***********************************End of AddId**********************************
  1945.  
  1946. function clearAll_Click(){
  1947.  
  1948. if (checklist.all== "[object]") {
  1949.   
  1950.   oTD=checklist.all.tags("INPUT");
  1951.   iTD= oTD.length;
  1952.  
  1953.   for (i=0; i<iTD; i++){
  1954.     oTD[i].checked=false;
  1955.   }
  1956.  
  1957. }
  1958.  
  1959. }
  1960.